#include "http.hpp"
int main()
{
    // 多组数据请求处理
    std::unique_ptr<Socket> client(new Socket);
    std::string req1 = "get /hello HTTP/1.1\r\nConnection: close\r\nContent-Length: 0\r\n\r\n";
    std::string req2 = "get /hello HTTP/1.1\r\nConnection: close\r\nContent-Length: 0\r\n\r\n";
    std::string req3 = "get /hello HTTP/1.1\r\nConnection: close\r\nContent-Length: 0\r\n\r\n";
    client->CreateClient(8888, "127.0.0.1");
    client->Send(req1.c_str(), req1.size());
    client->Send(req2.c_str(), req1.size());
    client->Send(req3.c_str(), req1.size());
    char buffer[1024] = {0};
    if (client->Recv(buffer, 1023) == -1)
    {
        INFO_LOG("断开连接退出");
        return 0;
    }
    INFO_LOG("收到数据:[%s]", buffer);
    client->Close();
}